package com.ly.feign;

import com.ly.config.MyFallbackFactory;
import com.ly.pojo.Products;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name = "SERVICE-PRODUCT",fallbackFactory = MyFallbackFactory.class)
public interface ProductFeign {
    /***
     * 通过id获取商品信息 * @param id * @return
     * */
    @RequestMapping("/production/findProductionById/{id}")
    public Products findProductionById(@PathVariable("id") Integer id);
    /**
     * 查询所有产品
     * */
    @RequestMapping("/production/findAllProduction")
    public List<Products> findAllProduction();

    /**
     * 获取端口号
     * */
    @GetMapping("/production/getPort")
    public String getPort();
}
